<?php 
namespace App\Http\Model;
use Illuminate\Database\Eloquent\Model;
// use Illuminate\Support\Facades\DB;
class Lists extends Model {

	//
	protected $table = 'list';
	protected $primarykey = 'id';
	public $timestamps =false;

	//添加分类
	static 	public function ad($request,$ts){
		$ts->validate($request, [
				'title'		 => 'required',
				'pid'		 => 'required',
				'keywords'   => 'required',
				'description'=> 'required',
				// 'image' 	 => 'required',
				'content' 	 => 'required'
			],
			[
				'title.required' 		=> '标题不能为空',
				'pid.required' 			=> '所属分类不能为空',
				'keywords.required' 	=> '关键字不能为空',
				'description.required'  => '描述不能为空',
				// 'image.required' 		=> '图片不能为空',
				'content.required' 		=> '内容不能为空'
			]
			);
				
	}
}

